//
//  JZHHuJinTableViewCell.m
//  极致荟
//
//  Created by hetao on 14-5-12.
//  Copyright (c) 2014年 mac. All rights reserved.
//

#import "JZHHuJinTableViewCell.h"
#import "JZHPersonaldetailsViewController.h"
@implementation JZHHuJinTableViewCell

- (void)awakeFromNib
{
    [self.headimage.layer setCornerRadius:6.0];
    [self.headimage.layer setMasksToBounds:YES];
    
   
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)addCellData:(OtherUsers *)ouser
{
    ouserd=ouser;
    [ImageCache imageUrl:ouser.userHeadImage UiImageview:self.headimage];
    self.age.text=[NSString stringWithFormat:@"%d岁",ouser.age];
    self.isstr.text=ouser.isStr;
    self.name.text=ouser.name;
    [self.name sizeToFit];
    
    if(ouser.sex==0)
    {
        self.seximage.image=[UIImage imageNamed:@"nvsex"];
        if(ouser.vip==0)
        {
            self.vipimage.image=[UIImage imageNamed:@"no0"];
        }
    }else
    {
        self.seximage.image=[UIImage imageNamed:@"nansex"];
        if(ouser.vip==0)
        {
            self.vipimage.image=[UIImage imageNamed:@"no1"];
        }
    }
    
    if(ouser.vip==1)
    {
        self.vipimage.image=[UIImage imageNamed:@"vip1"];
    }
    
    if(ouser.vip==2)
    {
        self.vipimage.image=[UIImage imageNamed:@"vip2"];
    }
    
    [self.vipimage setFrame:CGRectMake(self.name.frame.size.width+self.name.frame.origin.x+5, self.vipimage.frame.origin.y, 20, 20)];
    NSString *timestr= [[User defuceUser] lastLoginTime:ouser.lastLoginTime];
    NSString *jl=[NSString stringWithFormat:@"%.2fKm",ouser.distance];
    self.jt.text=[jl stringByAppendingFormat:@" %@",timestr];
    
}

@end
